#ifndef BANDEDSYSTEM_H_
#define BANDEDSYSTEM_H_

#include <vector>

class BandedSystem {
private:
  int m_n, m_kl, m_ku, m_ldab, m_ldb;
  double *m_AB, *m_B;
  int *m_ipiv;
  int m_info;

public:
  BandedSystem(int n, int kl, int ku);
  ~BandedSystem();

  inline double& elementOfA(int row, int col) {
    return m_AB[col*m_ldab + m_kl + m_ku + row - col];
  }

  inline double& elementOfB(int row) {
    return m_B[row];
  }

  int LUDecompose(void);
  int solveLU(void);
};

#endif /* BANDEDSYSTEM_H_ */
